home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vegask1a / printfor.frm < prev    next >
Text File  |  1999-02-21  |  3KB  |  131 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form print2form 
  4.    Caption         =   "Bragging Board"
  5.    ClientHeight    =   1665
  6.    ClientLeft      =   6510
  7.    ClientTop       =   4695
  8.    ClientWidth     =   2535
  9.    Icon            =   "printform.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1665
  12.    ScaleWidth      =   2535
  13.    ShowInTaskbar   =   0   'False
  14.    StartUpPosition =   2  'CenterScreen
  15.    Begin MSComDlg.CommonDialog CommonDialog1 
  16.       Left            =   0
  17.       Top             =   1200
  18.       _ExtentX        =   847
  19.       _ExtentY        =   847
  20.       _Version        =   393216
  21.    End
  22.    Begin VB.CommandButton cancel 
  23.       Cancel          =   -1  'True
  24.       Caption         =   "&CANCEL"
  25.       Height          =   375
  26.       Left            =   600
  27.       TabIndex        =   2
  28.       Top             =   1200
  29.       Width           =   1335
  30.    End
  31.    Begin VB.CommandButton printoptions 
  32.       Caption         =   "Print Keno Stats"
  33.       Height          =   375
  34.       Left            =   120
  35.       TabIndex        =   1
  36.       Top             =   600
  37.       Width           =   2295
  38.    End
  39.    Begin VB.CommandButton printboard 
  40.       Caption         =   "Command1"
  41.       Height          =   375
  42.       Left            =   120
  43.       TabIndex        =   0
  44.       Top             =   120
  45.       Width           =   2295
  46.    End
  47. End
  48. Attribute VB_Name = "print2form"
  49. Attribute VB_GlobalNameSpace = False
  50. Attribute VB_Creatable = False
  51. Attribute VB_PredeclaredId = True
  52. Attribute VB_Exposed = False
  53. Private Sub cancel_Click()
  54. Unload Me
  55. End Sub
  56.  
  57. Private Sub Form_Activate()
  58. If board.Visible = False Then
  59. printboard.Enabled = False
  60. printboard.Caption = "Display Keno Board To Print"
  61. Else
  62. printboard.Enabled = True
  63. printboard.Caption = "Print Keno Board"
  64. End If
  65. End Sub
  66.  
  67. Private Function printboardsub()
  68. If board.Visible = True Then
  69.     Dim BeginPage, EndPage, NumCopies, i
  70.     ' Set Cancel to True
  71.   CommonDialog1.CancelError = True
  72.     On Error GoTo ErrHandler
  73.     ' Display the Print dialog box
  74.    CommonDialog1.ShowPrinter
  75.     ' Get user-selected values from the dialog box
  76.     BeginPage = CommonDialog1.FromPage
  77.     EndPage = CommonDialog1.ToPage
  78.     NumCopies = CommonDialog1.Copies
  79.     For i = 1 To NumCopies
  80.     board.PrintForm
  81.     Next i
  82.     Exit Function
  83. ErrHandler:
  84.     ' User pressed the Cancel button
  85.     Exit Function
  86.     Else
  87.         MsgBox " display keno board to print", vbOKOnly
  88.         End If
  89. End Function
  90. Private Sub form_load()
  91. Call ShadeForm(Me)
  92. If board.Visible = False Then
  93. printboard.Enabled = False
  94. printboard.Caption = "Display Keno Board To Print"
  95. End If
  96.  
  97. End Sub
  98.  
  99. Private Sub printboard_Click()
  100. Call printboardsub
  101. End Sub
  102.  
  103. Private Sub printoptions_Click()
  104. statsform.Show
  105. End Sub
  106. Sub ShadeForm(Frm As Form)
  107.  
  108.  
  109.     Dim iLoop As Integer
  110.     Dim NumberOfRects As Integer
  111.     Dim GradColor As Long
  112.     Dim GradValue As Integer
  113.     Frm.ScaleMode = 3
  114.     Frm.DrawStyle = 6
  115.     Frm.DrawWidth = 2
  116.     Frm.AutoRedraw = True
  117.     NumberOfRects = 64
  118.     
  119.  
  120.     For iLoop = 1 To 64
  121.         GradValue = 255 - (iLoop * 4 - 1)
  122.         
  123.         GradColor = RGB(GradValue, GradValue, GradValue)
  124.         Frm.Line (0, Frm.ScaleHeight * (iLoop - 1) / 64)-(Frm.ScaleWidth, Frm.ScaleHeight * iLoop / 64), GradColor, BF
  125.         
  126.     Next iLoop
  127.  
  128.  
  129.     Frm.Refresh
  130. End Sub
  131.